package com.zjxmyq.microserviceyida.service;

import com.alibaba.fastjson.JSONObject;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@FeignClient(name = "dingtalk-api", url = "https://api.dingtalk.com", configuration = AccessTokenInterceptor.class)
// 指定要调用的服务名称
public interface YidaClient {

	@GetMapping("/v1.0/yida/processes/instanceIds")
	JSONObject getInstanceIds(@RequestBody JSONObject req);


	/**
	 * 获取实例ID列表
	 *
	 * @param hp
	 * @return
	 */
	@PostMapping("/v1.0/yida/processes/instanceIds")
	Object getIdList(@RequestBody HashMap<String, Object> hp);
//@PathVariabl路径参数必须要加的
	//requestparm给形式参数设置别名 达到前后端传参不一致的问题
	@GetMapping("/v1.0/yida/forms/instances/{id}")
	JSONObject getEngineerList(@PathVariable String id,
	                           @RequestParam String appType,@RequestParam String systemToken,@RequestParam String userId);



}
